using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.Mapping.HJT212DB
{
    public class PointInfoExMap : EntityTypeConfiguration<PointInfoEx>
    {
        public PointInfoExMap()
        {
            // Primary Key
            this.HasKey(t => new { t.P_ID, t.InfoxID });

            // Properties
            this.Property(t => t.P_ID)
                .IsRequired()
                .HasMaxLength(36);

            this.Property(t => t.InfoxID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.InfoxValue)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("PointInfoEx");
            this.Property(t => t.P_ID).HasColumnName("P_ID");
            this.Property(t => t.InfoxID).HasColumnName("InfoxID");
            this.Property(t => t.InfoxValue).HasColumnName("InfoxValue");
            this.Property(t => t.IsVisble).HasColumnName("IsVisble");
        }
    }
}
